<?php
/**
 * Description of Advertising
 *
 * @author NguyenVanTien
 */
class Application_Model_Advertising extends Application_Model_DbTable_Advertising {
    
    /**
     * Get list advertising with position
     * @param string $position
     * @author Tien Nguyen
     * @return Zend_Db_Select      
     */
    public function getListAdvertisingWithPosition($position){
        $select = $this->select();
        $select->from('advertising');
        $select->setIntegrityCheck(FALSE);
        $select->join('advertising_position', 
                'advertising_position.adversiting_id = advertising.adver_id',
                array());
        $select->where('advertising.is_deleted = ?', 0);
        $select->where('advertising.visible = ?', 1);
        $select->where('advertising_position.position = ?', $position);
        return $select;
    }

    /**
     * Get select adversiting logo
     * @author Tien Nguyen
     * @return Zend_Db_Select
     */
    public function getListAdvertisingLogo()
    {
        $select = $this->getListAdvertisingWithPosition('LOGO_HOME');
        return $select;
    }
}